package com.ruoyi.goods.controller;

import com.ruoyi.goods.domain.BmPreferential;
import com.ruoyi.goods.service.SellerService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author {那蓝桉}
 * @Date: 2023/08/11/ 11:46
 * @description
 */
@RestController
@RequestMapping("/seller")
public class SellerController extends BaseController {
    @Resource
    private SellerService sellerService;

    /**
     * 查询秒杀商品列表
     * @return
     */
    @GetMapping("/queryAll")
    public AjaxResult queryAll(){
        return AjaxResult.success(sellerService.queryAll());
    }

    /**
     * 根据秒杀商品id查询秒杀商品对象
     * @param id
     * @return
     */
    @GetMapping("/queryById/{id}")
    public AjaxResult queryById(@PathVariable("id") Long id){
        return AjaxResult.success(sellerService.queryById(id));
    }

    @GetMapping("/queryByStartTime")
    public AjaxResult queryByStartTime(){
        return AjaxResult.success(sellerService.queryByStartTime());
    }
    @GetMapping("/updateStatus/{id}")
    public AjaxResult updateStatus(@PathVariable("id") Long id){
        return AjaxResult.success(sellerService.updateStatus(id));
    }
    @GetMapping("/updateStatus0/{id}")
    public AjaxResult updateStatus0(@PathVariable("id") Long id){
        return AjaxResult.success(sellerService.updateStatus0(id));
    }
}
